#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int x;
	cin >> x;
	for (int i = 1;i < n;i++)
	{
		int y;
		cin >> y;
		if (y > x)
		{
			x = y;
		}
	}
	cout << x;
	return 0;
}